﻿//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Mapping Application Block
//===============================================================================

using System;

namespace EntLibContrib.Mapping
{
	/// <summary>
	/// Attribute to decorate domain object public fields and properties for automatic
	/// selection and mapping of domain objects from an assembly
	/// </summary>
	[AttributeUsage(AttributeTargets.Field|AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
	public sealed class MapAttribute : Attribute
	{
		#region Fields
		private string columnName;
		#endregion

		#region Properties
		/// <summary>
		/// Gets or sets the name of the mapped column.
		/// This will match the name of a column in the data transfer object.
		/// </summary>
		/// <value>The name of the mapped column.</value>
		public string ColumnName
		{
			get { return columnName; }
			set { columnName = value; }
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="MapAttribute"/> class.
		/// </summary>
		public MapAttribute()
		{ }
		#endregion
	}
}
